#include "localmachinetest.h"
#ifdef Q_OS_WIN
#include <windows.h>
#endif
#include <common/logger/logger.h>
LocalMachineTest::LocalMachineTest(QObject* parent)
{
}
void LocalMachineTest::initTestCase()
{
}
void LocalMachineTest::tstLocalMachine()
{
	LOG_INFO("Mac地址: ", LocalMachine::getMac(true));
	LOG_INFO("当前主机名: ", LocalMachine::getHostName());
	LOG_INFO("当前首个IP地址: ", LocalMachine::getIpAddress());
	LOG_INFO("所有IP地址: ", LocalMachine::getAllIpAddress());
	LOG_INFO("获取所有MAC地址用逗号分隔: ", LocalMachine::getMacAddressesAsString(true));
	LOG_INFO("获取CPUId: ", LocalMachine::getCPUId());
	LOG_INFO("获取主板信息: ", LocalMachine::getMainBoardId());
}
void LocalMachineTest::cleanupTestCase()
{
}

int main(int argc, char** argv)
{

	// 设置Windows控制台编码
#ifdef Q_OS_WIN
	// 设置控制台输出代码页为 UTF-8
	SetConsoleOutputCP(CP_UTF8);
	// 可选：设置控制台输入为 UTF-8
	SetConsoleCP(CP_UTF8);
#endif
	QApplication app(argc, argv);
	LocalMachineTest tc;
	return QTest::qExec(&tc, argc, argv);// qExec 会把失败信息打印到 stdout
}